import Vue from 'vue'
import VueRouter from 'vue-router'
import CartView from '../views/CartView.vue'
import HomeView from '../views/HomeView.vue'
import KindView from '../views/KindView.vue'
import MyView from '../views/MyView.vue'
import LoginView from '../views/LoginView.vue'
import ErrorView from '../views/ErrorView.vue'
import DetailView from '../views/DetailView.vue'
import MyMessageView from '../views/MyMessageView.vue'
import LocationView from '../views/LocationView.vue'
import HeaderView from '../components/Header/HeaderView.vue'
import FooterView from '../components/Footer/FooterView.vue'
import RegisterView from '../views/register/RegisterView.vue'
import SearchView from '../views/SearchView.vue'
import ClassView from '../views/ClassView.vue'
import Reg1View from '../views/register/Reg1View.vue'
import Reg2View from '../views/register/Reg2View.vue'
import Reg3View from '../views/register/Reg3View.vue'


Vue.use(VueRouter)

const routes = [
  {
    path:'/',
    redirect: '/home'
  },
  {
    path: '/home',
    name: 'home',
    components: {
      default: HomeView,
      FooterView
    }
  },
  {
    path: '/kind',
    name: 'kind',
    components: {
      default: KindView,
      HeaderView,
      FooterView
    }
  },
  {
    path: '/cart',
    name: 'cart',
    components: {
      default: CartView,
      FooterView
    }
  },
  {
    path: '/my',
    name: 'my',
    components: {
      default: MyView,
      FooterView
    }
  },
  {
    path: '/login',
    name: "login",
    component:LoginView
  },
  {
    path: '/register',
    name: 'register',
    component:RegisterView,
    redirect: '/register/one',
    children: [
      {path: '/register/one',
       name: 'Reg1',
       component:Reg1View
      },
      {path: '/register/two',
       name: 'Reg2',
       component:Reg2View
      },
      {path: '/register/three',
       name: 'Reg3',
       component:Reg3View
      }
    ]
  },
  {
    path: '/detail/:proid',
    name: 'detail',
    component: DetailView
  },
  {
    path: '/class',
    name: 'class',
    // component: ClassView
    components: {
      default: ClassView,
      HeaderView
    }
  },
  {
    path: '/search',
    name: 'search',
    component: SearchView
  },
  {
    path: '/mymessage',
    name: "mymessage",
    component:MyMessageView
  },
  {
    path: '/location',
    name: "location",
  component:LocationView
  },
  {
    path: '***',
    name: 'error',
    component: ErrorView
  }
  
]

const router = new VueRouter({
  routes
})

export default router
